package com.hrms.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hrms.dao.AdminDao;
import com.hrms.pojo.Admin;
import com.hrms.service.AdminService;

@Service("adminService")
public class AdminServiceImpl implements AdminService {

	@Resource
	private AdminDao adminDao;

	@Override
	public Admin isLogin(String adminName, String password) {
		return adminDao.login(adminName, password);
	}

	@Override
	public int alterPassword(Admin admin) {
		return adminDao.updatePassword(admin);
	}

	@Override
	public Admin getById(int adminId) {
		return adminDao.selectById(adminId);
	}

	@Override
	public int addAdminL0(String adminName, String password) {
		return adminDao.insertAdminL0(adminName, password);
	}

	@Override
	public int removeById(int adminId) {
		return adminDao.deleteById(adminId);
	}

	@Override
	public List<Admin> getAll() {
		return adminDao.selectAll();
	}

	@Override
	public Admin getByName(String adminName) {
		return adminDao.selectByName(adminName);
	}

}
